﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameEngineer.BaseMatrix
{
    public class RotateMatrix4X4 : Matrix4X4
    {
        //旋转角度
        private float mAngle { get; set; }

        public RotateMatrix4X4(float angle)
        {
            this.mAngle = angle;

            Init();
        }

        //布置旋转矩阵数据
        public void Init()
        {
            this[0, 0] = (float)Math.Cos(mAngle);
            this[0, 2] = (float)Math.Sin(mAngle);
            this[1, 1] = 1;
            this[2, 0] = -(float)Math.Sin(mAngle);
            this[2, 2] = (float)Math.Cos(mAngle);
            this[3, 3] = 1;
        }

        //设置旋转矩阵的旋转角度
        public void SetRotateAngle(float angle)
        {
            this.mAngle = angle;
        }
    }
}
